<template>
  <div>
    <el-button size="mini" type="primary" :icon="isView ? 'el-icon-more' : 'el-icon-edit'" @click="to" />
    <eForm ref="form" :sup-this="supThis" :is-add="false" :is-view="isView" />
  </div>
</template>
<script>
import eForm from './form'
// import { TextToCode } from 'element-china-area-data'

export default {
  components: { eForm },
  props: {
    isView: {
      type: Boolean,
      required: true
    },
    data: {
      type: Object,
      required: true
    },
    supThis: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      // console.log(this.data)
      const {
        id,
        personName,
        phone,
        account,
        personPassword,
        serviceproviderId,
        serviceproviderName,
        creatTime,
        state,
        techLevel,
        major,
        level,
        province,
        city,
        county
      } = this.data
      _this.form = {
        id,
        personName,
        phone,
        account,
        personPassword,
        personPasswordOrigin: personPassword,
        serviceproviderId,
        serviceproviderName,
        creatTime,
        state,
        techLevel,
        major,
        level,
        country: '中国',
        province,
        city,
        county
      }
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
